import { HttpGet, HttpPost } from '@/api/index.js'

/**
 * 新增配置
 * @param config
 */
export const add = (config) => {
    return HttpPost('/admin/system/config/add', config)
}

/**
 * 根据ID删除配置
 * @param id
 */
export const deleteById = (id) => {
    return HttpPost('/admin/system/config/deleteById/' + id)
}

/**
 * 更新配置信息
 * @param config
 */
export const edit = (config) => {
    return HttpPost('/admin/system/config/update', config)
}

/**
 * 分页列表
 * @param search
 */
export const pageList = (search) => {
    return HttpGet('/admin/system/config/listPage', search)
}

/**
 * 通过KEY获取配置信息
 * @param key
 */
export const getByKey = (key) => {
    return HttpGet('/admin/system/config/getByKey', {key})
}
